﻿// -----------------------------------------------------------------------------------------------
//  <copyright file="WaitCursor.cs" company="http://buginbox.wordpress.com/">
//    Copyright (c) GNU General Public License version 2 (GPLv2)
//  </copyright>
// -----------------------------------------------------------------------------------------------

using System;
using System.Windows.Forms;

namespace TestPlanMigration
{
    /// <summary>
    /// The wait cursor.
    /// </summary>
    public class WaitCursor : IDisposable
    {
        /// <summary>
        /// The cursor.
        /// </summary>
        private readonly Cursor cursor;

        /// <summary>
        /// Initializes a new instance of the <see cref="WaitCursor"/> class.
        /// </summary>
        public WaitCursor()
        {
            cursor = Cursor.Current;
            Cursor.Current = Cursors.WaitCursor;
        }

        /// <summary>
        /// The dispose.
        /// </summary>
        public void Dispose()
        {
            Cursor.Current = cursor;
        }
    }
}